<template>
  <div class='main'>
      <el-container>
      <el-aside width="200px">
        <!-- 左侧组件 -->
        <aside-view :list="list" v-if="list.length"></aside-view>
      </el-aside>
      <!-- 头部 -->
      <el-container>
        <el-header>
          <!-- 头部组件 -->
          <HeaderView></HeaderView>
        </el-header>
<!-- 主体 -->
        <el-main>
          <!-- 路由主体 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import HeaderView from "./components/HeaderView.vue";
import AsideView from "./components/AsideView.vue";
export default {
    components:{
      HeaderView,
      AsideView
    },
    name:"HomeView",
    data(){
      return {
        list:[]
      }
    },
    mounted(){
      // this.$router.getRoutes() 获取所有的路由
      this.list = this.$router.getRoutes().filter(item => item.meta.isShow)
    },
    
}
</script>

<style scoped lang='less'>

  
</style>